namespace Maple.Branch.Permissions.AppTests
{
    using System;
    using Microsoft.Extensions.DependencyInjection;
    using NSubstitute;
    using TestBases;
    using Volo.Abp.Users;

    public abstract class AppTestBase : PermissionsTestBase<PermissionsAppTestModule>
    {
        protected Guid? CurrentUserId { get; set; }

        protected AppTestBase()
        {
            CurrentUserId = Guid.NewGuid();
        }

        protected override void AfterAddApplication(IServiceCollection services)
        {
            var currentUser = Substitute.For<ICurrentUser>();

            //currentUser.Id.Returns(ci => CurrentUserId);
            currentUser.IsAuthenticated.Returns(true);

            services.AddSingleton(currentUser);
        }
    }
}
